import { Transform } from 'class-transformer';
import { IsOptional } from 'class-validator';
import { toNumber } from 'lodash';
import { DtoValidation } from 'src/decorators/custom-decorator';

@DtoValidation({ type: 'query' })
export class PaginDto {
  @IsOptional()
  @Transform(({ value }) => toNumber(value))
  pageNo = 1;

  @IsOptional()
  @Transform(({ value }) => toNumber(value))
  pageSize = 10;
}
